package com.foreknow.oppExer1.exer2;

/**
 * @author shkstart
 * @create 2021-07-28 13:33
 */
public class ClassA implements InterfaceA {
    /**
     * 计算1到n的和
     * @param n
     * @return
     */
    @Override
    public int method(int n) {
        int sum=0;
        for (int i = 1; i <=n; i++) {
            sum+=i;
        }
        return sum;
    }
}
